package CollectionTest.MyLink;
/*
链表节点对象
 */
public class Node {
    Object data;
    Node next;
    public Node(){

    }
    public Node(Object data, Node next){
        this.data = data;
        this.next = next;
    }

    public boolean equals(Object obj){
        if(obj == null || !(obj instanceof Node)) return false;
        if(obj == this) return true;
        Node n = (Node)obj;
        if(n.data == this.data && n.next == this.next){
            return true;
        }
        return false;
    }
}
